import { createRouter, createWebHashHistory } from "vue-router";

const routers = [
  {
    path: '/',
    redirect: '/index',
  },
  {
    path: '/index', // 首页
    name: 'index',
    component: () => import('../views/index/index.vue'),
    children: [
      {
        path: '/index/recommend', // 推荐
        name: 'recommend',
        component: () => import('../views/index/recommend/index.vue')
      },
      {
        path: '/index/food', // 美食
        name: 'food',
        component: () => import('../views/index/food/index.vue')
      },
      {
        path: '/index/dressing', // 穿搭
        name: 'dressing',
        component: () => import('../views/index/dressing/index.vue')
      },
      {
        path: '/index/movie', // 电影
        name: 'movie',
        component: () => import('../views/index/movie/index.vue')
      },
    ]
  },
  {
    path: '/release', // 发现
    name: 'release',
    component: () => import('../views/release/index.vue')
  },
  {
    path: '/notice', // 通知
    name: 'notice',
    component: () => import('../views/notice/index.vue')
  },
  {
    path: '/my', // 我的
    name: 'my',
    component: () => import('../views/my/index.vue')
  },
  {
    path: '/detail', // 详情
    name: 'detail',
    component: () => import('../views/detail/index.vue')
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: routers,
  linkActiveClass: 'active'
})

export default router